<?php

namespace App\Transformers;

use App\Models\Wallet;

class WalletTransformer extends BaseTransformer
{
    public function transform(Wallet $model)
    {
        return [
            'id' => $model->id,
            'user_id' => $model->user_id,                           #用户id
            'balance' => $model->balance,                           #余额
            'alipay_account' => $model->alipay_account,             #支付宝账号
            'true_name' => $model->true_name,                       #真实姓名
            'bank_account' => $model->bank_account,                 #银行卡账号
            'bank' => $model->bank,                                 #开户行
            'is_set_pay_password' => !!$model->pay_password,        #是否设置支付密码
        ];
    }
}
